//
//  Core+UIColor.swift
//  Example
//
//  Created by Slience on 2021/3/16.
//

import UIKit
import Hue
enum ZFColorType:String {
    
    case color_33 = "#333333"
    case color_66 = "#666666"
    case color_aa = "#aaaaaa"
    case color_f1 = "#f1f1f1"
    case color_21 =  "#212121"
    case color_f9 = "#f9f9f9"
    case color_99 = "#999999"
    case theme = "#3A5BFF"
    case color_cb = "#CBCBCB"
    case color_00 = "000000"
    case color_22 = "222222"
    case color_3c = "3c3c3c"
    
    
}
extension UIColor {
    
    static func colorWithLightColor(lightColor:UIColor,darkColor:UIColor) ->UIColor{
        return UIColor.init { trait -> UIColor in
            if trait.userInterfaceStyle == .dark{
                return darkColor
            }
            return lightColor
        }
    }
    
    static func colorType(light:ZFColorType,dark:ZFColorType) -> UIColor{
        let lightColor = UIColor.init(hex: light.rawValue)
        let darkColor = UIColor.init(hex: light.rawValue)
        return colorWithLightColor(lightColor: lightColor , darkColor: darkColor);
    }
}
